using System;
using System.Collections.Generic;
using System.Text;
using IGGCore;

namespace IGGConsole
{
    /// <summary>
    /// The single news formatter for the console app.
    /// </summary>
    public class ModeSingleNewsFormatter : IModeFormatter
    {
        #region IModeFormatter Members

        /// <summary>
        /// Format a single news for the console app.
        /// The news is randomly picked from an array of news in the scoreboard.
        /// </summary>
        public void FormatMode(Scoreboard board)
        {
            Random rnd = new Random();
            News singleNews = board.News[rnd.Next(board.News.Count)];

            Console.WriteLine();
            Console.WriteLine(" " + singleNews.Title.ToUpper());
            Console.WriteLine();
            StringFormatter.FormatLongText(singleNews.Content);
            Console.WriteLine();
            Console.WriteLine(" " + singleNews.Provider);
            Console.WriteLine(" " + singleNews.Date);
        }

        #endregion
    }
}
